home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / gdb / copying.awk < prev    next >
Text File  |  1992-09-11  |  2KB  |  65 lines

  1. BEGIN    {
  2.       FS="\"";
  3.       print "/* Do not modify this file; it is created automatically";
  4.       print "   by copying.awk.  */";
  5.       print "#include <stdio.h>"
  6.       print "#include \"defs.h\""
  7.       print "#include \"command.h\""
  8.       print "#include \"gdbcmd.h\""
  9.       print "extern int immediate_quit;";
  10.       print "static void";
  11.       print "copying_info ()";
  12.       print "{";
  13.       print "  immediate_quit++;";
  14.     }
  15. NR == 1,/^[     ]*NO WARRANTY[     ]*$/    {
  16.       if ($0 ~ / /)
  17.         {
  18.           printf "  printf_filtered (\"\\n\");\n";
  19.         }
  20.       else if ($0 !~ /^[     ]*NO WARRANTY[     ]*$/) 
  21.         {
  22.           printf "  printf_filtered (\"";
  23.           for (i = 1; i < NF; i++)
  24.         printf "%s\\\"", $i;
  25.           printf "%s\\n\");\n", $NF;
  26.         }
  27.     }
  28. /^[     ]*NO WARRANTY[     ]*$/    {
  29.       print "  immediate_quit--;";
  30.       print "}";
  31.       print "";
  32.       print "static void";
  33.       print "warranty_info ()";
  34.       print "{";
  35.       print "  immediate_quit++;";
  36.     }
  37. /^[     ]*NO WARRANTY[     ]*$/, /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/{  
  38.       if (! ($0 ~ /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/)) 
  39.         {
  40.           printf "  printf_filtered (\"";
  41.           for (i = 1; i < NF; i++)
  42.         printf "%s\\\"", $i;
  43.           printf "%s\\n\");\n", $NF;
  44.         }
  45.     }
  46. END    {
  47.       print "  immediate_quit--;";
  48.       print "}";
  49.       print "";
  50.       print "void"
  51.       print "_initialize_copying ()";
  52.       print "{";
  53.       print "  add_info (\"copying\", copying_info,";
  54.       print "        \"Conditions for redistributing copies of GDB.\");";
  55.       print "  add_info (\"warranty\", warranty_info,";
  56.       print "        \"Various kinds of warranty you do not have.\");";
  57.       print "  add_cmd (\"copying\", no_class, copying_info,";
  58.       print "       \"Conditions for redistributing copies of GDB.\",";
  59.       print "       &showlist);";
  60.       print "  add_cmd (\"warranty\", no_class, warranty_info,";
  61.       print "       \"Various kinds of warranty you do not have.\",";
  62.       print "       &showlist);";
  63.       print "}";
  64.     }
  65.